#include "DonorType.h"

#include "iostream"
#include "iomanip"

using namespace std;

void DonorType::setDonorInfo(
        const string &firstName,
        const string &lastName,
        int membershipNumber,
        double donationAmount)
{
    (*this).setMemberInfo(firstName, lastName, membershipNumber);
    (*this).donationAmount = donationAmount;
}

void DonorType::setAmountDonated(double donationAmount)
{
    (*this).donationAmount = donationAmount;
}

double DonorType::getAmountDonated() const
{
    return donationAmount;
}

void DonorType::printDonor() const
{
    (*this).printMemberInfo();
}

void DonorType::printDonation() const
{
    cout << setiosflags(ios::fixed);
    cout << "(" << (*this).getMembershipNo() << ") "
        << (*this).getLastName() << ", " << (*this).getFirstName()
        << endl
        << "    Donation amount: $" << setprecision(2)
        << (*this).donationAmount << endl;
}

bool DonorType::operator<(const DonorType &anotherDonorList) const
{
    return (*this).getMembershipNo() < anotherDonorList.getMembershipNo();
}

bool DonorType::operator==(int anotherDonorID) const
{
    return (*this).getMembershipNo() == anotherDonorID;
}

